package com.net.oil.shop.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.shop.bean.ShopDetailBean;
import com.net.oil.shop.contract.ShopDetailContract;
import com.net.oil.shop.model.ShopDetailModel;

/**
 * 作者：lch
 * 时间：2018/4/3:10:01
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class ShopDetailPresenter extends BasePresenter<ShopDetailContract.View> implements ShopDetailContract.Presenter {

    private ShopDetailContract.View view;
    private ShopDetailContract.Model model;

    public ShopDetailPresenter(ShopDetailContract.View view) {
        this.view = view;
        model = new ShopDetailModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getShopDetail(int id) {
        model.getShopDetail(id);
    }

    @Override
    public void getShopDetailSuccess(ShopDetailBean shopDetailBean) {
        view.getShopDetailSuccess(shopDetailBean);
    }

    @Override
    public void getShopDetailFailed() {
        view.getShopDetailFailed();
    }

    @Override
    public void reserveOrder(int bid, String time, int userCarId) {
        model.reserveOrder(bid, time, userCarId);
    }

    @Override
    public void reserveOrderSuccess() {
        view.reserveOrderSuccess();
    }

    @Override
    public void reserveOrderFailed() {
        view.reserveOrderFailed();
    }
}
